<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('地图城市表列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>省份：</label>
                            <input type="text" name="province"/>
                        </li>
                        <li>
                            <label>区域：</label>
                            <input type="text" name="city"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm"
                               onclick="$.table.search('formId', 'bootstrap-table1')"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm"
                               onclick="$.form.reset('formId', 'bootstrap-table1')"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar1" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="fanruan:city:add">
                <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()"
               shiro:hasPermission="fanruan:city:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
               shiro:hasPermission="fanruan:city:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="fanruan:city:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table1"></table>
        </div>
    </div>
</div>

<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId2">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>项目名称：</label>
                            <input type="text" name="proName"/>
                        </li>
                        <li>
                            <label>区域：</label>
                            <input type="text" name="districtName"/>
                        </li>
                        <li>
                            <label>所属集团：</label>
                            <input type="text" name="square"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm"
                               onclick="$.table.search('formId2', 'bootstrap-table2')"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm"
                               onclick="$.form.reset('formId2', 'bootstrap-table2')"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar2" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="fanruan:program:add">
                <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()"
               shiro:hasPermission="fanruan:program:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
               shiro:hasPermission="fanruan:program:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="fanruan:program:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table2"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('fanruan:city:edit')}]];
    var removeFlag = [[${@permission.hasPermi('fanruan:city:remove')}]];
    var prefix = ctx + "fanruan/city";

    $(function () {
        var options = {
            id: "bootstrap-table1",
            toolbar: "toolbar1",
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "地图城市表",
            columns: [{
                checkbox: true
            },
                {
                    field: 'province',
                    title: '省份',
                    width: 300,
                },
                {
                    field: 'city',
                    title: '区域',
                    width: 300,
                },
                {
                    field: 'coordinates',
                    title: '坐标',
                    width: 300,
                    formatter: function (value, row, index) {
                        return $.table.tooltip(value,50);
                    }
                },
                {
                    field: 'project',
                    title: '项目总数',
                    width: 300,
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });

    var prefix1 = ctx + "fanruan/program";
    $(function () {
        var options = {
            id: "bootstrap-table2",
            toolbar: "toolbar2",
            url: prefix1 + "/list",
            createUrl: prefix1 + "/add",
            updateUrl: prefix1 + "/edit/{id}",
            removeUrl: prefix1 + "/remove",
            exportUrl: prefix1 + "/export",
            modalName: "项目列表",
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: '主键id',
                    visible: false
                },
                {
                    field: 'proName',
                    title: '项目名称'
                },
                {
                    field: 'districtName',
                    title: '区域'
                },
                {
                    field: 'longitude',
                    title: '精度'
                },
                {
                    field: 'latitude',
                    title: '维度'
                },
                {
                    field: 'investAmt',
                    title: '所属集团'
                },
                {
                    field: 'square',
                    title: '项目团队'
                },
                {
                    field: 'proUrl',
                    title: '模型地址'
                },
                {
                    field: 'monitorUrl',
                    title: '监控视频地址'
                },
                {
                    field: 'angle',
                    title: '角度'
                },
                {
                    field: 'height',
                    title: '高度'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });

</script>
</body>
</html>